<div class="row">
  <div class="col span-6">
    <label class="acc-label">{{t "generic.member"}}</label>
    {{input-identity
      allowTeams=true
      allowLocal=true
      action=(action "addPrincipal")
      onError=gotError
    }}
  </div>
  <div class="col span-12">
    {{#sortable-table
       classNames="grid sortable-table"
       sortBy=sortBy
       headers=membersHeaders
       stickyHeader=false
       bulkActions=false
       search=false
       pagingLabel="pagination.member"
       descending=descending
       body=resource.members
       as |sortable kind member dt|
    }}
      {{#if (eq kind "row")}}
        <tr class="main-row">
          <td data-title="{{dt.memberName}}:">
            {{member.displayName}}
          </td>
          <td data-title="{{dt.type}}:" >
            {{member.displayType}}
          </td>
          <td data-title="{{dt.accessType}}:">
            {{#if (gt optionsForAccessType.length 1)}}
              <select
                class="form-control"
                onchange={{action (mut member.accessType) value="target.value"}}
              >
                {{#unless (eq member.accessType "")}}
                  <option value="" selected=true>
                    {{t "formMembersGlobalAccess.table.prompt"}}
                  </option>
                {{/unless}}
                {{#each optionsForAccessType as |choice|}}
                  <option value="{{choice}}" selected={{eq choice member.accessType}}>
                    {{choice}}
                  </option>
                {{/each}}
              </select>
            {{else}}
              {{member.accessType}}
            {{/if}}
          </td>
          <td data-title="{{t "generic.actions"}}:" class="actions">
            <div class="p-5">
              <button
                class="btn bg-primary btn-sm" type="button" {{action removeMember member}}
              >
                <i class="icon icon-minus"/>
              </button>
            </div>
          </td>
        </tr>
          {{else if (eq kind "nomatch")}}
        <td
          colspan="5"
          class="text-center text-muted lacsso pt-20 pb-20"
        >
          {{t "formMembersGlobalAccess.table.noMatch"}}
        </td>
          {{else if (eq kind "norows")}}
        <td
          colspan="5"
          class="text-center text-muted lacsso pt-20 pb-20"
        >
          {{t "formMembersGlobalAccess.table.noData"}}
        </td>
      {{/if}}
    {{/sortable-table}}
  </div>
</div>